// Plasmachine Gun

ACTOR PlasMachineGun : IDMWeapon
{
  Weapon.SelectionOrder 100
  //Weapon.PreferredSkin "PlasmaGunMarine"
  Weapon.AmmoUse 1
  Weapon.AmmoGive 40
  Weapon.AmmoType "IDMCell"
  Inventory.PickupMessage "Plasmachine Gun! (Slot 6)"
  Tag "Plasmachine Gun"
  +WEAPON.NOLMS
  States
  {
  Ready:
    PLMG A 1 A_WeaponReady
    Loop
  Deselect:
    PLMG A 0 A_Lower
    PLMG A 0 A_Lower
	PLMG A 1 A_Lower
    Loop
  Select:
	TNT1 A 0 A_PlaySound("weapons/wswitch",CHAN_WEAPON)
  Sloop:
	PLMG A 0 A_Raise
	PLMG A 0 A_Raise
	PLMG A 1 A_Raise
    Loop
  Fire:
	TNT1 A 0 A_PlaySound("weapons/plmgchr",CHAN_WEAPON)
	PLMG A 3
	PLMG BC 3 Bright
  Hold:
	PLMG A 0 A_GunFlash
	PLMG A 0 A_JumpIfInventory("PowerIDMWeaponLevel2", 1, "Level2")
	PLMG A 0 A_JumpIfInventory("PowerQuadDamage", 1, "Quad")
  Normal:
    PLMG A 0 A_FireCustomMissile("BigPlasmaBall",frandom(-6,6),1,6,1)
    PLMG A 3 A_FireCustomMissile("BigPlasmaBall",frandom(-6,6),1,-6,1)
	TNT1 A 0 A_Refire
	PLMG B 0 A_GunFlash("Flash2")
    PLMG D 30
    Goto Ready
  Level2:
	PLMG A 0 A_JumpIfInventory("PowerQuadDamage", 1, "QuadLevel2")
    PLMG A 0 A_FireCustomMissile("BigPlasmaBall2",frandom(-6,6),1,6,1)
    PLMG A 3 A_FireCustomMissile("BigPlasmaBall2",frandom(-6,6),1,-6,1)
	TNT1 A 0 A_Refire
	PLMG B 0 A_GunFlash("Flash2")
    PLMG D 30
    Goto Ready
  Quad:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    PLMG A 0 A_FireCustomMissile("ExtremeBigPlasmaBall",frandom(-6,6),1,6,1)
    PLMG A 3 A_FireCustomMissile("ExtremeBigPlasmaBall",frandom(-6,6),1,-6,1)
	TNT1 A 0 A_Refire
	PLMG B 0 A_GunFlash("Flash2")
    PLMG D 30
    Goto Ready
  QuadLevel2:
	TNT1 A 0 A_Playsound("misc/qdmg2",CHAN_5)
    PLMG A 0 A_FireCustomMissile("ExtremeBigPlasmaBall2",frandom(-6,6),1,6,1)
    PLMG A 3 A_FireCustomMissile("ExtremeBigPlasmaBall2",frandom(-6,6),1,-6,1)
	TNT1 A 0 A_Refire
	PLMG B 0 A_GunFlash("Flash2")
    PLMG D 30
    Goto Ready
  Flash:
    PLMF A 1 Bright A_Light1
    PLMF B 1 Bright A_Light1
    PLMF A 2 Bright A_Light1
    Goto LightDone
  Flash2:
	PLMG D 2 Bright A_Light0
	Goto LightDone
  Spawn:
    PLMS A -1 Bright
    Stop
  }
}

// Plasmachine Gun's Plasma

ACTOR BigPlasmaBall : IDMPlasmaBall
{
	Speed 35
	Obituary "%o was dissolved by %k's Plasmachine Gun."
	Seesound "weapons/plmgf"
}

ACTOR ExtremeBigPlasmaBall : BigPlasmaBall
{
	+EXTREMEDEATH
	States
	{
	XDeath:
		TNT1 A 0 A_Playsound("misc/crit",CHAN_AUTO)
		Goto Death
	}
}

ACTOR BigPlasmaBall2 : IDMPlasmaBall2
{
	Speed 32
	Obituary "%o was dissolved by %k's Plasmachine Gun."
	Seesound "weapons/plmg2f"
}

ACTOR ExtremeBigPlasmaBall2 : BigPlasmaBall2
{
	ProjectileKickback 400
	+EXTREMEDEATH
	States
	{
	XDeath:
		TNT1 A 0 A_Playsound("misc/crit",CHAN_AUTO)
		Goto Death
	}
}